<?php
namespace app\admin\controller;

use app\common\controller\Admin;

class Video extends Admin
{
    public function update()
    {
        $result = \daicuo\Op::write([
            'video_in'       => DcSwitch(input('post.video_in/s')),
            'video_size'     => input('post.video_size/s'),
            'video_ai'       => input('post.video_ai/s'),
            'video_frontUrl' => input('post.video_frontUrl/s'),
            'video_frontTime'=> input('post.video_frontTime/s'),
            'video_endUrl'   => input('post.video_endUrl/s'),
            'video_endTime'  => input('post.video_endTime/s'),
            'video_pause'    => input('post.video_pause/s'),
            'video_buffer'   => input('post.video_buffer/s'),
            'video_advUnit'  => input('post.video_advUnit/s'),
        ],'common','video','system','0','yes');
        if( !$result ){
            $this->error(lang('fail'));
        }
        $this->success(lang('success'));
    }
    
    public function index()
    {
        $this->assign('fields', DcFormItems(model('admin/Video','loglic')->fields()));
        
        $this->assign('query', $this->query);
        
        return $this->fetch();
    }
}